<!DOCTYPE html>
<html ng-app="playgroundApp">
  <head>
    <title>Cloud Playground</title>
    <link rel="stylesheet" href="/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="/codemirror/lib/codemirror.css">
    <link rel="stylesheet" href="/playground/css/app.css">
    <!-- load angular in head section to ensure ngCloak CSS is loaded -->
    <script src="/playground/lib/angular/angular.js"></script>
    <script src="/playground/lib/angular-ui/angular-ui.js"></script>

    <script src="/codemirror/lib/codemirror.js"></script>

    <script src="/codemirror/mode/clike/clike.js"></script>
    <script src="/codemirror/mode/css/css.js"></script>
    <script src="/codemirror/mode/htmlmixed/htmlmixed.js"></script>
    <script src="/codemirror/mode/javascript/javascript.js"></script>
    <script src="/codemirror/mode/sql/sql.js"></script>
    <script src="/codemirror/mode/php/php.js"></script>
    <script src="/codemirror/mode/python/python.js"></script>
    <script src="/codemirror/mode/shell/shell.js"></script>
    <script src="/codemirror/mode/xml/xml.js"></script>
    <script src="/codemirror/mode/yaml/yaml.js"></script>

    <script src="/codemirror/addon/edit/matchbrackets.js"></script>

  </head>
  <body ng-cloak ng-controller="PageController">
    <div id="container" ng-class="{iframed: iframed}">

      <!-- cover up IFRAMEs during drag -->
      <div id="drag-div" class="hidden">
      </div>
      <div id="header" ng-controller="HeaderController" ng-hide="iframed">
        <a class="logo" ng-href="/playground"><span class='app-back' pg-visible="!alreadyhome()">&#x2039;</span>Cloud Playground</a>
        <sup class="experimental">experimental</sup>

        <div class="topbar">
          <div class="email">
            <span><i class="icon-user"></i> {{config.email}}</span>
            <button ng-show="config.is_logged_in" class="btn" onclick="window.location='/playground/logout'">logout</button>
            <button ng-hide="config.is_logged_in" class="btn btn-success" onclick="window.location='/playground/login'">login</button>
          </div>
        </div>
      </div>

      <div ng-controller="AlertController">
        <alert ng-repeat="alert in alerts()" type="alert.type" close="closeAlert($index)" class="alert-reduced-margin"><i class="{{alert.icon}}"></i> {{alert.msg}}</alert>
      </div>

      <div id="main">
        <div ng-view></div>
      </div>

      <div id="footer" ng-show="!iframed && loaded">
        <div class="diag">
          <span>namespace: {{namespace()}}</span>
        </div>
        <div class="adminlinks">
          <span>git(<a class="link" ng-href="{{config.git_playground_url}}" target="_blank">cloud-playground</a>)</span>

          <span ng-show="config.is_admin">danger(<a class="link" ng-click="big_red_button()">big-red-button</a>)</span>

          <span ng-show="config.is_admin">oauth2(<a class="link" ng-click="oauth2_admin('github', 'https://github.com/settings/applications/38287')">github</a>)</span>

          <span ng-show="config.is_admin || config.is_devappserver">
            admin(<a class="link" ng-click="datastore_admin()" target="_blank">datastore</a>,
                  <a class="link" ng-click="memcache_admin()" target="_blank">memcache</a>)
          </span>

        </div>
      </div>
    </div>

    <script src='/ui-bootstrap/ui-bootstrap-tpls-0.1.0.js'></script>
    <script src="/playground/js/app.js"></script>
    <script src="/playground/js/services.js"></script>
    <script src="/playground/js/controllers.js"></script>
    <script src="/playground/js/filters.js"></script>
    <script src="/playground/js/directives.js"></script>
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-34864136-2', 'cloud-playground.appspot.com');
  ga('send', 'pageview');

</script>
  </body>
</html>
